package com.airline.form;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.LabelValueBean;
import org.apache.struts.validator.ValidatorForm;

import com.airline.beans.Flight;

public class SearchFlightForm extends ValidatorForm{
	
	
	public Flight getFlight() {
		return flight;
	}

	public void setFlight(Flight flight) {
		this.flight = flight;
	}

	public String getFlightid() {
		return flightid;
	}

	public void setFlightid(String flightid) {
		this.flightid = flightid;
	}

	Flight flight = new Flight();
	String error = null;
	String flightid = null;
	
	
	ArrayList sourceList = new ArrayList();
	ArrayList destList = new ArrayList();
	ArrayList airlinenameList = new ArrayList();
	
	public SearchFlightForm() {
		
		sourceList.add(new LabelValueBean("JFK","JFK"));
		sourceList.add(new LabelValueBean("LAX","LAX"));
		sourceList.add(new LabelValueBean("MSP","MSP"));
		sourceList.add(new LabelValueBean("PDX","PDX"));
		sourceList.add(new LabelValueBean("ORD","ORD"));
		sourceList.add(new LabelValueBean("SEA","SEA"));
		sourceList.add(new LabelValueBean("DEN","DEN"));
		sourceList.add(new LabelValueBean("DCA","DCA"));
		sourceList.add(new LabelValueBean("SFO","SFO"));
		
		
		destList.add(new LabelValueBean("JFK","JFK"));
		destList.add(new LabelValueBean("LAX","LAX"));
		destList.add(new LabelValueBean("MSP","MSP"));
		destList.add(new LabelValueBean("PDX","PDX"));
		destList.add(new LabelValueBean("ORD","ORD"));
		destList.add(new LabelValueBean("SEA","SEA"));
		destList.add(new LabelValueBean("DEN","DEN"));
		destList.add(new LabelValueBean("DCA","DCA"));
		destList.add(new LabelValueBean("SFO","SFO"));
		
		
		airlinenameList.add(new LabelValueBean("DELTA","DELTA"));
		airlinenameList.add(new LabelValueBean("ALASKA","ALASKA"));
		airlinenameList.add(new LabelValueBean("UNITED","UNITED"));
		airlinenameList.add(new LabelValueBean("SOUTHWEST","SOUTHWEST"));
		
	}

	public ArrayList getSourceList() {
		return sourceList;
	}

	public void setSourceList(ArrayList sourceList) {
		this.sourceList = sourceList;
	}

	public ArrayList getDestList() {
		return destList;
	}

	public void setDestList(ArrayList destList) {
		this.destList = destList;
	}

	public ArrayList getAirlinenameList() {
		return airlinenameList;
	}

	public void setAirlinenameList(ArrayList airlinenameList) {
		this.airlinenameList = airlinenameList;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	@Override
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		
		
		//UpdateFlightForm form = (UpdateFlightForm) request.getSession().getAttribute("updateFlightForm");
		
	//	this.flight = form.getFlight();
	}

	
	


}
